home *** CD-ROM | disk | FTP | other *** search
- Path: maverick.tad.eds.com!news-admin@tad.eds.com
- From: Perry Hoekstra <lnusmsc.phoeks01@eds.com>
- Newsgroups: comp.lang.c++
- Subject: unsigned char question
- Date: Thu, 29 Feb 1996 23:08:27 -0600
- Organization: EDS
- Message-ID: <3136864B.7154@eds.com>
- NNTP-Posting-Host: 206.120.14.44
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (Win95; I)
-
- This is a basic question but one I cannot answer. I am using VC++ 2.0
- and I wish to assign a string to a variable of type UCHAR * (which is an unsigned char
- within ODBC). The code is as follows
-
- UCHAR * server;
-
- server = "jmbademo";
-
- When I attempt to compile this piece of code, I receive the following error:
-
- C:\cgi\Envvars\Envvar.cpp(417) : error C2446: '=' : no conversion from 'char[9]' to
- 'unsigned char*'
-
- In addition, when I try to copy or concatenate with lstrcpy or lstrcat, I receive the
- following error:
-
- C:\cgi\Envvars\Envvar.cpp(432) : error C2664: 'lstrcpyA' : cannot convert parameter 1 from
- 'unsigned char*' to 'char*'
-
- C:\cgi\Envvars\Envvar.cpp(433) : error C2664: 'lstrcatA' : cannot convert parameter 1 from
- 'unsigned char*' to 'char*'
-
- I am taking these code examples straight from Microsoft's examples for ODBC calls in their
- MSDN CD-ROM (i.e. Static SQL Example). What am I doing wrong or how would you code a
- SQLConnect call within VC++ 2.0?
-
- Thank you
-
- Perry Hoekstra
- lnusmsc.phoeks01@eds.com
-